package com.s10.ecloud.web.dao.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.s10.ecloud.web.dao.IDeviceTypeDAO;
import com.s10.ecloud.web.model.DeviceType;

@Repository
public class DeviceTypeDAO implements IDeviceTypeDAO {
	@Resource
	private SessionFactory sessionFactory;

	@Override
	public List<DeviceType> getDeviceTypeList() {
		// TODO Auto-generated method stub
		List list = sessionFactory.getCurrentSession()
				.createQuery("from DeviceType").list();

		if (list == null) {
			return new ArrayList<DeviceType>();
		}

		return list;
	}
}
